<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <script>
        //限定字符
        //    1.*：出现0次到无数次
        //   var reg = /a*/;
        /*  var str = "fdsg";
                                                            console.log(reg.test(str)); */
        // 2.+:一次到多次
        /*  var reg = /a+/;
                                                    var str = "fsdags";
                                                    console.log(reg.test(str)); */
        // 3.?:0次到一次
        /*  var reg = /a?/;
                                      var str = "sdgaasv";
                                      console.log(reg.test(str)); */
        // 4.指定出现的次数：{次数}
        /* var reg = /da{3}/;
                              var str = "dsfghdfgadaaa";
                              console.log(reg.test(str)); */
        //5.指定次数 出现区间{最少出现次数，最多出现次数}
        /*  var reg = /ga{2,5}s/;
                  var str = "asdgaasdg";
                  console.log(reg.test(str)); */
        //6.指定次数到无限次{最少出现的次数}
        /*  var reg = /ha{2,}w/;
          var str = "adfsgsfsfhaawe";
          console.log(reg.test(str)); */
    </script>
</body>

</html>